#! /bin/bash


hello(){
	echo "这是一个不带参数，不带return的函数"
	echo "这是第一个shell函数！"
}


fun_with_return(){
	echo "这是一个不带参数，带有return的函数"
	echo "输入第一个数字："
	read num_1
	echo "输入第二个数字："
	read num_2
	echo "输入的两个数字分别是$num_1 和 $num_2"
	return $(($num_1+$num_2))
	
}

fun_with_para(){

	echo "总共有 $# 个参数！"
	echo "第一个参数为：$1！"
	echo "作为一个字符串输出所有参数：$*"
}

echo "test function fun_with_para()"
fun_with_para 1 2 3
echo "test fun_with_para finished"

echo "test function hello()."
hello
echo "test hello finished."

echo "test function fun_with_return()"
fun_with_return
echo "输入的两个数之和为：$? !"
echo "test fun_with_return finished"

